/**
 * 
 */
package br.com.insight.consultoria.apresentacao.noticias;

import br.com.insight.consultoria.entity.Noticia;
import br.com.insight.consultoria.erro.exception.InsightException;
import br.com.insight.consultoria.negocio.fachada.noticia.FachadaNoticia;

/**
 * @author emival@gmail.com
 *
 */
public final class ManterNoticiasMB extends Object {

	
	private Noticia noticia;
	
	private FachadaNoticia fachadaNoticia;
	public FachadaNoticia getFachadaNoticia() {
		return fachadaNoticia;
	}
	public void setFachadaNoticia(FachadaNoticia fachadaNoticia) {
		this.fachadaNoticia = fachadaNoticia;
	}
	public Noticia getNoticia() {
		if (noticia == null) {
			noticia = new Noticia();
		}
		return noticia;
	}
	
	public void inserir(){
		try {
			getFachadaNoticia().inserir(getNoticia());
			System.out.println(noticia.getId());
		} catch (InsightException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
